MyDlgHook
A dialog hook function should have the following form:
pascal short MyDlgHook (short item, DialogPtr theDialog, Ptr myDataPtr);
item
- The number of the item selected.
theDialog
- A pointer to the dialog structure for the dialog box.
myDataPtr
- A pointer to the optional data whose address is passed to
CustomGetFilePreview
.DESCRIPTION
You supply a dialog hook function to handle user selections of items that you added to a dialog box. If you provide a dialog hook function,CustomGetFilePreview
calls your function immediately after calling the Dialog Manager'sModalDialog
function. It passes your function the item number returned byModalDialog
, a pointer to the dialog structure, and a pointer to the data received from your application, if any.Your dialog hook function returns as its function result an integer that is either the item number passed to it or some other item number. If your dialog hook function does not handle a selection, it should pass the item number back to the Standard File Package for processing by setting its return value equal to the item number. If your dialog hook function does handle the selection, it should pass back
sfHookNullEvent
or the number of some other pseudo-item.SEE ALSO
See Inside Macintosh: Files for another sample dialog hook function.